Skip to content

feat: structured agent access — 'becwright check --json' + MCP server (phase B)#18

Merged
DataDave-Dev merged 1 commit into
mainfrom
feat/mcp-and-json
Jun 30, 2026
Merged

feat: structured agent access — 'becwright check --json' + MCP server (phase B)#18
DataDave-Dev merged 1 commit into
mainfrom
feat/mcp-and-json

Conversation

@DataDave-Dev

Copy link
Copy Markdown
Owner

Summary

Phase B of the AI-agent integration: gives agents machine-readable access to becwright, on top of the Claude Code plugin (#17). Two additions, no impact on the minimal-deps core.

becwright check --json

A JSON summary instead of colored text — consumable without parsing. Exit code unchanged (1 if a blocking rule failed). Shares logic with a new report.py module (also used by the MCP server). No extra dependency; works from the standalone npm binary too.

{ "rule_count": 3, "checked_files": 1, "blocked": true,
  "results": [ { "id": "no-debugger-js", "severity": "blocking", "passed": false, "intent": "...", "why_it_matters": "...", "output": "app.js:1\n      > ..." } ] }

becwright mcp — universal MCP server

A stdio MCP server exposing check and list_checks to any MCP-capable agent (Claude, Cursor, Windsurf). Lazily imported and shipped behind the optional mcp extra, so the core stays pyyaml-only; a missing extra prints a helpful install hint.

Client config:

{ "mcpServers": { "becwright": { "command": "becwright", "args": ["mcp"] } } }

Notes

  • git.repo_root() gains an optional cwd so MCP tools can target a given path.
  • The MCP server ships only with the Python package (not the npm binary); CLI/hook use without Python keeps working via npm.

Test plan

  • 121 tests pass; coverage 91% (threshold 80%)
  • check --json verified (blocking + clean repos), valid JSON, correct exit codes
  • MCP tools registered (check, list_checks); check returns correct payload; list_checks returns all built-ins (tests use importorskip("mcp"); mcp added to the dev extra so CI runs them)
  • Missing-extra path returns exit 2 with install hint
  • claude plugin validate still passes after the skill note
  • Dogfood becwright check passes

Gives AI agents machine-readable results, the universal layer on top of the
Claude Code plugin.

- 'becwright check --json': JSON summary (rule_count, checked_files, blocked,
  per-rule results) sharing logic with the new report.py module; exit code
  unchanged. No extra dependency; works from the standalone binary too.
- 'becwright mcp': an MCP (stdio) server exposing 'check' and 'list_checks' to
  any MCP-capable agent (Claude, Cursor, Windsurf). Lazily imported; ships behind
  the optional 'mcp' extra so the core stays pyyaml-only. Helpful error if the
  extra is missing.
- git.repo_root() gains an optional cwd so MCP tools can target a given path.
- Docs (documentation/mcp.md + es), README sections, and a skill note; tests for
  report, --json, the MCP tools (importorskip) and the missing-extra path.

Coverage 91%; 121 tests pass. Completes the planned agent integration
(plugin + structured access).
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DataDave-Dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: efe85b5f-387f-4584-8533-83b0a2feaf4a

📥 Commits

Reviewing files that changed from the base of the PR and between cc5c1ee and 80d798f.

📒 Files selected for processing (13)
  • README.es.md
  • README.md
  • documentation/mcp.es.md
  • documentation/mcp.md
  • integrations/claude-code/skills/becwright/SKILL.md
  • pyproject.toml
  • src/becwright/cli.py
  • src/becwright/git.py
  • src/becwright/mcp_server.py
  • src/becwright/report.py
  • tests/test_cli_and_git.py
  • tests/test_mcp.py
  • tests/test_report_and_json.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mcp-and-json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DataDave-Dev
DataDave-Dev merged commit 6dba17a into main Jun 30, 2026
3 checks passed
@DataDave-Dev
DataDave-Dev deleted the feat/mcp-and-json branch June 30, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant